home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / write.z / write
Encoding:
Text File  |  1998-10-30  |  5.3 KB  |  132 lines

  1.  
  2.  
  3.  
  4. wwwwrrrriiiitttteeee((((DDDD2222))))                                                            wwwwrrrriiiitttteeee((((DDDD2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _wwww_rrrr_iiii_tttt_eeee - write data to a device
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_eeee_rrrr_rrrr_nnnn_oooo_...._hhhh_>>>>
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_uuuu_iiii_oooo_...._hhhh_>>>>
  15.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_cccc_rrrr_eeee_dddd_...._hhhh_>>>>
  16.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
  17.      _iiii_nnnn_tttt _p_r_e_f_i_x_wwww_rrrr_iiii_tttt_eeee_((((_dddd_eeee_vvvv______tttt _d_e_v_,,,, _uuuu_iiii_oooo______tttt _****_u_i_o_p_,,,, _cccc_rrrr_eeee_dddd______tttt _****_c_r_p_))))_;;;;
  18.  
  19.    AAAArrrrgggguuuummmmeeeennnnttttssss
  20.      _d_e_v       Device number.
  21.  
  22.      _u_i_o_p      Pointer to the _uuuu_iiii_oooo(D4) structure that describes where the data
  23.                is to be fetched from user space.
  24.  
  25.      _c_r_p       Pointer to the user credential structure for the I/O
  26.                transaction.
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      The driver _wwww_rrrr_iiii_tttt_eeee routine is called during the _wwww_rrrr_iiii_tttt_eeee(2) system call.  The
  30.      _wwww_rrrr_iiii_tttt_eeee routine is responsible for transferring data from the user data
  31.      area to the device.
  32.  
  33.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  34.      The _wwww_rrrr_iiii_tttt_eeee routine should return 0 for success, or the appropriate error
  35.      number.
  36.  
  37. UUUUSSSSAAAAGGGGEEEE
  38.      This entry point is optional, and is valid for character device drivers
  39.      only.
  40.  
  41.      The pointer to the user credentials, _c_r_p, is available so the driver can
  42.      check to see if the user can write privileged information, if the driver
  43.      provides access to any.  The _uuuu_iiii_oooo structure provides the information
  44.      necessary to determine how much data should be transferred.  The
  45.      _uuuu_iiii_oooo_mmmm_oooo_vvvv_eeee(D3) function provides a convenient way to copy data using the _uuuu_iiii_oooo
  46.      structure.
  47.  
  48.      Block drivers that provide a character interface can use _pppp_hhhh_yyyy_ssss_iiii_oooo_cccc_kkkk(D3) to
  49.      perform the data transfer with the driver's _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy(D2) routine.
  50.  
  51.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  52.      The _wwww_rrrr_iiii_tttt_eeee routine has user context and can sleep.
  53.  
  54.      The write operation is intended to be synchronous from the caller's
  55.      perspective.  Minimally, the driver _wwww_rrrr_iiii_tttt_eeee routine should not return until
  56.      the caller's buffer is no longer needed.  For drivers that care about
  57.      returning errors, the data should be committed to the device.  For
  58.      others, the data might only be copied to local staging buffers.  Then the
  59.      data will be committed to the device asynchronously to the user's
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. wwwwrrrriiiitttteeee((((DDDD2222))))                                                            wwwwrrrriiiitttteeee((((DDDD2222))))
  70.  
  71.  
  72.  
  73.      request, losing the ability to return an error with the associated
  74.      request.
  75.  
  76. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  77.      _dddd_rrrr_vvvv______pppp_rrrr_iiii_vvvv(D3), _eeee_rrrr_rrrr_nnnn_oooo_ssss(D5), _pppp_hhhh_yyyy_ssss_iiii_oooo_cccc_kkkk(D3), _rrrr_eeee_aaaa_dddd(D2), _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy(D2), _uuuu_iiii_oooo(D4),
  78.      _uuuu_iiii_oooo_mmmm_oooo_vvvv_eeee(D3), _uuuu_wwww_rrrr_iiii_tttt_eeee_cccc(D3)
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.